import 'package:flutter/cupertino.dart';
import 'package:love_app/common/su.dart';
import 'package:love_app/common/su_dio.dart';
import 'package:love_app/config/path_url.dart';
import 'package:love_app/model/love_record_model.dart';
import 'package:love_app/model/response_model.dart';

// 获取恋人记录
class LoveRocordApi{

  // 发起获取恋人记录
  Future<LoveRecordModel> getLoveRecord(String token, {@required int page}) async {
    Map headers = {
      'X-Auth-Token': token,
    };
    String path = PathUrl.getLoveRecord + '/' + page.toString();
    ResponseModel responseModel = await SuDio().getRequest(path, headersMap: headers);
    LoveRecordModel model =  LoveRecordModel.fromJson(responseModel.toJsonModel);
    return model;
  }
}